#include <stdio.h>
/**
 *  Writes "hello world" in the given file 
 * 
 *  name    filetest.c
 *  version 1.0
 *  author  Prof. Dr.-Ing. Damian Weber (dweber@htw-saarland.de)
 */
int main(int argc, char **argv)
{
  // are there enough params?
  if(argc <= 1)
  {
    return 1;
  }
   
  FILE *filePointer = 0;
  
  filePointer = fopen(argv[1],"w");
  // has fopen been successful?
  if(!filePointer)
  {
     return 1;
  }
  
  // writes "hello world\n" in the given file (argv[1])
  fprintf(filePointer, "hello world\n");
  fclose(filePointer);

  return 0;
}